<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div id="main_depart_list" class="easyui-layout" fit="true">
  <div region="center" style="padding:1px;">
  <t:datagrid name="tSNoticeList" checkbox="true" fitColumns="true" title="common.notice" actionUrl="noticeController.do?datagrid2" idField="id" fit="true" queryMode="group">
   <t:dgCol title="ID"  field="id"  hidden="true"  queryMode="group"  width="120"></t:dgCol>
   <t:dgCol title="通知标题"  field="noticeTitle"  hidden="false"  queryMode="group"  width="320"></t:dgCol>
   <t:dgCol title="是否上线"  field="isOnline"  hidden="true"  queryMode="group"  width="320"></t:dgCol>
   <t:dgCol title="common.operation" field="opt" width="100"></t:dgCol>
   <t:dgDelOpt title="common.delete" url="noticeController.do?doDel&id={id}" />
   <t:dgFunOpt  funname="editItemDetail({'编辑'},{'noticeController.do?goUpdate'},id,{'840'},{'500'})" title="编辑"  /> 
   <t:dgFunOpt    funname="setOnline(id)" title="发布"  exp="isOnline#eq#0" /> 
   <t:dgFunOpt    funname="setOffline(id)" title="下线"  exp="isOnline#eq#1" />
   <t:dgToolBar title="common.add" icon="icon-add" url="noticeController.do?goAdd" funname="add" width="840" height="500"></t:dgToolBar> 
   <t:dgToolBar title="common.batchDelete"  icon="icon-remove" url="noticeController.do?doBatchDel" funname="deleteALLSelect"></t:dgToolBar>
   
  </t:datagrid>
  </div>
 </div>
 <div data-options="region:'east',
	title:'通知公告授权管理',
	collapsed:true,
	split:true,
	border:false,
	onExpand : function(){
		li_east = 1;
	},
	onCollapse : function() {
	    li_east = 0;
	}"
	style="width: 500px; overflow: hidden;">
<div class="easyui-panel" style="padding: 1px;" fit="true" border="false" id="subListpanel"></div>
</div>

 <script type="text/javascript">
 function setOnline(id){
	 //confirm(,"确定要发布吗?","确认");
	 var url = 'noticeController.do?setOnline&state=1&id='+id;
	 
	 $.ajax({
			async : false,
			cache : false,
			type : 'POST',
			data : '',
			url : url,// 请求的action路径
			error : function() {// 请求失败处理函数
			},
			success : function(data) {
				var d = $.parseJSON(data);
				if (d.success) {
					var msg = d.msg;
					tip(msg);
					reloadTable();
				}
			}
		});
	 
 }
 //下线
 function setOffline(id){  
	 
 	var url = 'noticeController.do?setOffline&state=0&id='+id;
	 
	 $.ajax({
			async : false,
			cache : false,
			type : 'POST',
			data : '',
			url : url,// 请求的action路径
			error : function() {// 请求失败处理函数
			},
			success : function(data) {
				var d = $.parseJSON(data);
				if (d.success) {
					var msg = d.msg;
					tip(msg);
					reloadTable();
				}
			}
		});
 }
 
 
 </script>
